<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<div class="span8 offset2">
    <form class="form-horizontal well" method="POST" action="MainServlet?action=scheduled.item.save">
        <fieldset>
            <legend>New scheduled item</legend>
            <div class="hidden">
                <input type="hidden" name="id" value="0">
            </div>
            <div class="control-group">
                <label class="control-label" for="route">Route:</label>
                <div class="controls">
                    <select class="myinput" id="route" name="route">
                        <option value="0" selected="true"></option>
                        <c:forEach var="route" items="${routeList}">
                            <option value="<c:out value="${route.getId()}" />"><c:out value="${route.getRouteName()}" /></option>
                        </c:forEach>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="departureTime">Departure time:</label>
                <div class="controls">
                    <input class="myinput" type="text" id="departureTime" name="departureTime" value="">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="arrivalTime">Arrival time:</label>
                <div class="controls">
                    <input class="myinput" type="text" id="arrivalTime" name="arrivalTime" value="">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="departureTimeFromEndPoint">Departure time from end point:</label>
                <div class="controls">
                    <input class="myinput" type="text" id="departureTimeFromEndPoint" name="departureTimeFromEndPoint" value="">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="arrivalTimeToBusTerminal">Arrival time to bus terminal:</label>
                <div class="controls">
                    <input class="myinput" type="text" id="arrivalTimeToBusTerminal" name="arrivalTimeToBusTerminal" value="">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="routingDays">Routing days:</label>
                <div class="controls">
                    <fieldset name="routingDays" id="routingDays">
                        <c:forEach var="day" items="${daysOfWeekList}">
                            <label class="checkbox">
                                <input type="checkbox" name="routingDays" id="routingDays_<c:out value="${day.toString().toLowerCase()}" />" value="<c:out value="${day.toString()}" />" /><c:out value="${day.toString()}" />
                            </label>
                        </c:forEach>
                    </fieldset>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="platformNumber">Platform number:</label>
                <div class="controls">
                    <input class="myinput" type="text" id="platformNumber" name="platformNumber" value="">
                </div>
            </div>
            <div class="form-actions">
                <input type="submit" class="btn btn-primary" name="saveButton" value="Create new scheduled item">
                <button class="btn" id="cancelButton" name="cancelButton" data-button-to-click="cancelButtonOutOfForm">Cancel</button>
            </div>
        </fieldset>
    </form>
    <button class="btn" id="cancelButtonOutOfForm" data-link="scheduled-item-list" style="display: none; visibility: hidden; height: 0px; width: 0px;">Cancel</button>
</div>
